{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-education.tpl"}</nav>
    <article class="right-col">
        <h2><a href="{$back}">{$arrSmarty.category[$row.type]}</a> &raquo; Cập nhật</h2></li>                        
        <form name="frmEdit" id="frmEdit" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}education/saveedit" class="ui">
            <input type="hidden" name="peducateid" id="peducateid" value="{$row.educateid}" />
            <input type="hidden" name="pparentid" id="pparentid" value="{$row.parentid}" />
            <input type="hidden" name="pcontent" id="pcontent" value="" />
            <input type="hidden" name="ptbfeature" id="ptbfeature" />
            <input type="hidden" name="pfulladdr" id="pfulladdr" />
            <input type="hidden" name="ptype" id="ptype" value="{$row.type}" />
            <ul>
                {if isset($smarty.session.EDUCATION_ERROR)}
                	<li class="error">
                    	{include file="common/error.tpl" dataSession=$smarty.session.EDUCATION_ERROR}                        
                    </li>
                {/if}                
                {if $arrAlbum}
                    <li>
                        <label for="palbumid">Album sideshow:</label>
                        <div class="sel">
<select id="palbumid" name="palbumid">
                            <option value="0">--Chọn--</option>
                            {foreach item=item from=$arrAlbum}
                                <option value="{$item.albumid}" {if isset($smarty.session.EDUCATION_POST.palbumid) && $smarty.session.EDUCATION_POST.palbumid==$item.albumid}selected="selected"{elseif $row.albumid == $item.albumid}selected="selected"{/if}>{$item.name} ({$item.timage} hình)</option>
                            {/foreach}
                        </select></div>
                    </li>
                {/if}
                <li>
                    <label for="pcategoryid">Loại trường <span class="required">*</span>:</label>                        
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                                <option value="{$item.categoryid}" {if isset($smarty.session.EDUCATION_POST.pcategoryid) && $smarty.session.EDUCATION_POST.pcategoryid==$item.categoryid}selected="selected"{elseif $row.categoryid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="psubid">Phân cấp:</label>
                    <div class="sel">
                        <select id="psubid" name="psubid">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrSub}
                                <option value="{$item.categoryid}" {if isset($smarty.session.EDUCATION_POST.pcategoryid) && $smarty.session.EDUCATION_POST.psubid==$item.categoryid}selected="selected"{elseif $row.subid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}                            
                        </select>
                    </div>
                </li>                    
                {if $arrSpec}
                    <li>
                        <label>Chuyên ngành:</label>  
                        <div class="chk">                                      
                            <ul>
                                {foreach item=item key=i from=$arrSpec}
                                    <li><input type="checkbox" name="pspec[]" id="pspec{$item.categoryid}" value="{$item.categoryid}" {if isset($smarty.session.EDUCATION_POST.pspec)&&$smarty.session.EDUCATION_POST.pspec[$i]==$item.categoryid}checked="checked"{elseif $arrCateS[$item.categoryid] == $item.categoryid}checked="checked"{/if} class="chk" /><label class="chk" for="psub{$i}">{$item.name}</label></li>
                                {/foreach}
                            </ul>         
                        </div>                   
                    </li>
                {/if}                   
                <li>
                    <label for="pname">Tên trường <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.EDUCATION_POST.pname)}{$smarty.session.EDUCATION_POST.pname|escape}{else}{$row.name|escape}{/if}" maxlength="255" />
                    </div>
                </li>
                <li>
                    <label for="pprovince">Tỉnh/thành <span class="required">*</span>:</label>
                    <div class="sel">
<select id="pprovince" name="pprovince">
                        <option value="0">---Chọn--</option>
                        {if isset($smarty.session.EDUCATION_POST.pprovince)}
                            {html_options options=$arrProvince selected=$smarty.session.EDUCATION_POST.pprovince}
                        {else}
                            {html_options options=$arrProvince selected=$row.province}
                        {/if}
                    </select></div>
                </li>
                <li>
                    <label for="pdistrict">Quận/huyện <span class="required">*</span>:</label>
                    <div class="sel">
<select id="pdistrict" name="pdistrict">
                        <option value="0">---Chọn--</option>
                        {if isset($smarty.session.EDUCATION_POST.pdistrict)}
                            {html_options options=$arrDistrict selected=$smarty.session.EDUCATION_POST.pdistrict}
                        {else}
                            {html_options options=$arrDistrict selected=$row.district}
                        {/if}
                    </select></div>
                </li>  
                <li>
                    <label for="paddr">Địa chỉ <span class="required">*</span>:</label>
                    <div class="txt">
                    <input type="text" class="text" name="paddr" id="paddr" value="{if isset($smarty.session.EDUCATION_POST.paddr)}{$smarty.session.EDUCATION_POST.paddr}{else}{$row.addr|escape}{/if}"/>
                    </div>
                </li> 
                <li>
                    <label for="platitude">Vĩ độ <span class="required">*</span>:</label>
                    <div class="txt">
                    <input type="text" class="text" id="platitude" name="platitude" value="{if isset($smarty.session.EDUCATION_POST.platitude)}{$smarty.session.EDUCATION_POST.platitude|escape}{else}{$row.latitude|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="plongitude">Kinh độ <span class="required">*</span>:</label>
                    <div class="txt">
                    <input type="text" class="text" id="plongitude" name="plongitude" value="{if isset($smarty.session.EDUCATION_POST.plongitude)}{$smarty.session.EDUCATION_POST.plongitude|escape}{else}{$row.longitude|escape}{/if}"/>
                    </div>
                </li>
                                             
                {if $row.parentid == 0}
                    <li>
                        <label for="plink">Link website:</label>
                        <div class="txt">
                        	<input type="text" class="text" name="plink" id="plink" value="{if isset($smarty.session.EDUCATION_POST.plink)}{$smarty.session.EDUCATION_POST.plink|escape}{else}{$row.website|escape}{/if}" maxlength="255" />
                        </div>
                    </li> 
                {/if}
                <li>
                    <label for="ptel">Điện thoại:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptel" id="ptel" value="{if isset($smarty.session.EDUCATION_POST.ptel)}{$smarty.session.EDUCATION_POST.ptel|escape}{else}{$row.tel|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="pfax">Fax:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pfax" id="pfax" value="{if isset($smarty.session.EDUCATION_POST.pfax)}{$smarty.session.EDUCATION_POST.pfax|escape}{else}{$row.fax|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="pemail">Email:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pemail" id="pemail" value="{if isset($smarty.session.EDUCATION_POST.pemail)}{$smarty.session.EDUCATION_POST.pemail|escape}{else}{$row.email|escape}{/if}"/>
                    </div>
                </li>
                {if $row.parentid == 0}
                    <li>
                        <label for="pimage">Logo:</label>
                        <div class="txt">
                        	<input type="file" class="text" name="pimage" id="pimage" value="" />
                        </div>
                    </li>     
                    {if $row.logo != ""}
                        <li>
                            <label for="pimage">Logo đã đăng:</label>
                            <div class="txt">
                            	{image path=$row.logo type="education" attr="style=\"max-width:640px;float:left;\""}
                            </div>
                        </li>
                    {/if}
                    <li>
                        <label for="pshort">Sơ lược</label>
                        <div class="area">
                        	<textarea cols="1" rows="1" name="pshort" id="pshort">{if isset($smarty.session.EDUCATION_POST.pshort)}{$smarty.session.EDUCATION_POST.pshort}{else}{$row.short}{/if}</textarea>
                        </div>
                    </li>
                    <li>
                        <label for="fckcontent">Giới thiệu:</label>
                        <div class="area">
                        	<textarea rows="1" cols="1" name="fckcontent" id="fckcontent">{if isset($smarty.session.EDUCATION_POST.pcontent)}{$smarty.session.EDUCATION_POST.pcontent}{else}{$row.content}{/if}</textarea>
                        </div>
                    </li>                                 
                {/if}
                {if $row.parentid == 0}                     
                    <li>
                        <label>Thông tin mở rộng:</label>                             
                        {include file="common/table-feature.tpl"}
                    </li>
                {/if}
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.EDUCATION_POST.ptag)}{$smarty.session.EDUCATION_POST.ptag|escape}{else}{$row.tag|escape}{/if}" maxlength="100" />
                    </div>
                </li>                                                   
                <li>
                    <button type="submit">Lưu dữ liệu</button>
                    <button type="button" onclick="document.location.href='{$back}'" class="cancel">Hủy</button>
                </li>
           	</ul> 
        </form>
	</article>
</section>
{include file="common/footer.tpl"}
                
